import {
  secklist
} from '../../../request/api'

const state = {
  secklist: []
}

const getters = {
  getSeckill(state) {
    return state.secklist
  }
}
const mutations = {
  REQ_SECKILL(state, payload) {
    state.secklist = payload
  }
}

const actions = {
  getSeckillAction({
    commit
  }) {
    secklist().then(res => {
      commit("REQ_SECKILL", res.list)
    })
  }
}

export default {
  state,
  getters,
  mutations,
  actions,
  namespaced: true
}